<?php include_once 'photo_header.php';?>
<!--主体内容-->
<div class="main">
	<?php include_once 'photo_left.php';?>

	<div class="photo_right">
    	<div class="photo_title">
        	<ul>
            <li><a href="index.php?mod=photo&code=my_new">最新照片</a></li>
            <li><a href="index.php?mod=photo&code=my_movement">我的动态</a></li>
            <li class="on"><a href="index.php?mod=photo&code=my">我的相册</a></li>
            </ul>
            <span><a href="javascript:void(0);" onClick="javascript:showfloat();">创建相册</a></span>
        </div>
    	<div class="photo_message">
       共有4个相册，74张照片
        </div>
        <div class="photo_list">
        	<ul>
		<?php foreach($album as $a){ ?>
            <li onmouseover="openShutManager('edit<?php echo $a['id'];?>')" onmouseout="openShutManager('edit<?php echo $a['id'];?>')" class="li_high">
			<a href="<?php echo $a['album_first'];?>"><img src="<?php echo $a['pic'];?>" /><h2><?php echo $a['title'];?></h2></a>
            <span>照片(<?php echo $a['pics_count'];?>)  评论(<?php echo $a['comm_count'];?>)<br /><?php echo $a['addtime'];?>更新</span>
            <span class="edit" id="edit<?php echo $a['id'];?>" style=" display:none;"><a href="javascript:void(0);" onClick="javascript:editAlbum('<?php echo $a['id'];?>','<?php echo $a['title'];?>','<?php echo $a['category'];?>','<?php echo $a['description'];?>');" class="p_edit">编辑</a>
			<a href="index.php?mod=photo&code=album_del&id=<?php echo $a['id'];?>" class="p_del">删除</a></span>
            </li>
		<?php } ?>
            </ul>
   			<div class="float_both"></div>
			<div class="page">
				<span class="l">当前显示 <?php echo $page; ?> 篇/共 <?php echo $total_page; ?> 篇 </span> |
				<span class="r">
				<?php echo $page_arr['html'] ;?>
				</span>
			</div>
   			<div class="float_both"></div>
        </div>
        <div class="photo_title photo_title2">
        </div>
    </div>
    <div class="float_both"></div>
</div>

<div id="edit_album_overlay_div" class="overlay_div"><iframe style="height:100%; width:100%;"></iframe></div>
<div id="edit_album_form" class="float_layer" style="display:none;"></div>
<script type="text/javascript">
function editAlbum(id,title,category,desc){
	var html = '<div class="float_title">创建相册</div>';
		html += '<form action="index.php?mod=photo&code=album_edit&ref=my&id='+id+'" method="post">';
		html += '<table width="100%" border="0" cellspacing="0" cellpadding="0" class="float_table">';
		html += '<tr>';
		html += ' <th valign="top">相册名称：</th>';
		html += '  <td valign="top" width="250"><input type="text" id="album_title" name="album_title" value="'+title+'" class="float_text"/></td>';
		html += '  <td valign="middle"></td>';
		html += ' </tr>';
		html += ' <tr>';
		html += ' <th valign="top">相册分类：</th>';
		html += ' <td valign="top"><select class="float_text" name="album_category" id="album_category">';
		<?php foreach($album_category as $key=>$val){ ?>
		html += '<option value="<?php echo $val;?>"><?php echo $val;?></option>';
		<?php } ?>		
		html += ' </select></td>';
		html += '     <td valign="middle"></td>';
		html += '   </tr>';
		html += '  <tr>';
		html += '   <th valign="top">相册描述：</th>';
		html += '   <td valign="top"><textarea cols="" rows="3" id="album_desc" name="album_desc" class="float_textarea">'+desc+'</textarea></td>';
		html += '   <td valign="middle"></td>';
		html += ' </tr>';
		html += ' <tr>';
		html += '   <th valign="top"></th>';
		html += '   <td><input type="submit" value="修改" class="float_button_s" /> <input type="button" onClick="editAlbumHide()" value="取消" class="float_button" /></td>';
		html += '   <td>&nbsp;</td>';
		html += '  </tr>';
		html += '</table>';
		html += '	</form>';
		html += '	<div style="postion:relative;">';
		html += '		<div class="close_btn" onClick="editAlbumHide()"><img src="templates/app/images/flow_close.gif" /></span></div>';
		html += '	</div>';
	$('#edit_album_form').html(html);
	$('#edit_album_overlay_div').show();
	$('#edit_album_form').show();
	$('#album_category').val(category);
}
function editAlbumHide(){
	$('#edit_album_form').hide();
	$('#edit_album_overlay_div').hide();
}
</script>
<!--底部-->
<?php include_once 'photo_album_div.php';?>
<?php include_once 'footer.php';?>
